﻿<Window 
        x:Class="FaceTrackingBasics.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:FaceTrackingBasics"
        xmlns:System="clr-namespace:System;assembly=mscorlib"
        Title="Face Tracking Basics"
        Closed="WindowClosed"
        Height="735" Width="770" 
        >

    <Window.Resources>
        <SolidColorBrush x:Key="MediumGreyBrush" Color="#ff6e6e6e"/>
        <SolidColorBrush x:Key="KinectPurpleBrush" Color="#ff52318f"/>
        <SolidColorBrush x:Key="KinectBlueBrush" Color="#ff00BCF2"/>
        <Style TargetType="{x:Type Image}">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
        </Style>
        
        <ObjectDataProvider x:Key="dataFromEnum" MethodName="GetValues" ObjectType="{x:Type System:Enum}">
            <ObjectDataProvider.MethodParameters>
                <x:Type TypeName="local:DrawFeaturePoint"/>
            </ObjectDataProvider.MethodParameters>
        </ObjectDataProvider>

    </Window.Resources>

    <Grid Name="layoutGrid" Margin="10 0 10 10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <DockPanel Grid.Row="0" Margin="0 0 0 20">
            <Image DockPanel.Dock="Left" Source="Images\Logo.png" Stretch="Fill" Height="32" Width="81" Margin="0 10 0 5"/>
            <TextBlock DockPanel.Dock="Right" Margin="0 0 -1 0" VerticalAlignment="Bottom" Foreground="{StaticResource MediumGreyBrush}" FontFamily="Segoe UI" FontSize="18">Face Tracking Basics</TextBlock>
            <Image Grid.Column="1" Source="Images\Status.png" Stretch="None" HorizontalAlignment="Center" Margin="0 0 0 5"/>
        </DockPanel>
        <Viewbox Grid.Row="1" Stretch="Uniform" HorizontalAlignment="Center" ClipToBounds="True">
            <Grid Name="MainGrid" Width="640" Height="480">
                <Image Name="ColorImage" RenderTransformOrigin="0.5,0.5">
                    <Image.RenderTransform>
                        <ScaleTransform>
                            <ScaleTransform.ScaleX>
                                <Binding ElementName="slider1" Path="Value" Mode="OneWay"/>
                            </ScaleTransform.ScaleX>
                            <ScaleTransform.ScaleY>
                                <Binding ElementName="slider1" Path="Value" Mode="OneWay"/>
                            </ScaleTransform.ScaleY>
                        </ScaleTransform>
                    </Image.RenderTransform>
                </Image>
                <local:FaceTrackingViewer x:Name="faceTrackingViewer" RenderTransformOrigin="0.5,0.5">
                    <local:FaceTrackingViewer.RenderTransform>
                        <ScaleTransform>
                            <ScaleTransform.ScaleX>
                                <Binding ElementName="slider1" Path="Value" Mode="OneWay"/>
                            </ScaleTransform.ScaleX>
                            <ScaleTransform.ScaleY>
                                <Binding ElementName="slider1" Path="Value" Mode="OneWay"/>
                            </ScaleTransform.ScaleY>
                        </ScaleTransform>
                    </local:FaceTrackingViewer.RenderTransform>
                </local:FaceTrackingViewer>

            </Grid>
        </Viewbox>
        <StackPanel Orientation="Horizontal" Grid.Row="2" >
            <CheckBox Name="chkDraw3DMesh" Height="25" IsEnabled="True" Content="Draw 3D Mesh" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Click="chkDraw3DMesh_Click" />
            <CheckBox Name="chkDrawShapePoints" Height="25" IsEnabled="True" Content="Draw 2D Shape Points" HorizontalContentAlignment="Left" VerticalContentAlignment="Center" Click="chkDrawShapePoints_Click" Margin="25,0,0,0" />
            <Label Content="Feature Point:" Height="25" Margin="25,0,0,0" />
            <ComboBox Name="cboDrawFeaturePoints" Width="100" Height="25" ItemsSource="{Binding Source={StaticResource dataFromEnum}, Mode=OneWay}" SelectionChanged="cboDrawFeaturePoints_SelectionChanged" />
            <Label Content="Zoom:" Height="25" Margin="25,0,0,0" />
            <Slider Name="slider1" Height="25" Width="100" Orientation="Horizontal" Minimum="0.25" Maximum="5.0" Value="1.0" TickFrequency="0.5" TickPlacement="BottomRight" LargeChange="0.25" />
        </StackPanel>
   </Grid>
</Window>
